﻿ <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
	<base th:href="${url}">
<link href="jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="jquery/jquery-1.11.1-min.js"></script>
<script type="text/javascript" src="jquery/bootstrap_3.3.0/js/bootstrap.min.js"></script>
</head>
<body>
<div style="position: absolute; top: 0px; left: 0px; width: 60%;">
	<img src="image/111.JPG" style="width: 100vw; height: 90vh; position: relative; top: 50px;">
</div>
<div id="top" style="height: 50px; background-color: #3C3C3C; width: 100%;">
	<div style="position: absolute; top: 5px; left: 0px; font-size: 30px; font-weight: 400; color: white; font-family: 'times new roman'">物流系统 &nbsp;<span style="font-size: 12px;">骑鱼的吃货大人</span></div>
</div>

<div style="position: absolute; top: 120px; right: 100px;width:450px;height:400px;border:1px solid #D5D5D5;background: rgba(255,255,255,0.3)">
	<div style="position: absolute; top: 0px; right: 60px;">
		<div class="page-header">
			<h1>登录</h1>
		</div>
		<form class="form-horizontal">
			<div class="form-group form-group-lg">
				<div style="width: 350px;">
					<input class="form-control" id="loginAct" type="text" th:value="${loginAct}" placeholder="用户名">
				</div>
				<div style="width: 350px; position: relative;top: 20px;">
					<input class="form-control" id="loginPwd" type="password" th:value="${loginPwd}" placeholder="密码">
				</div>
				<div class="checkbox"  style="position: relative;top: 30px; left: 10px;">
					<label>
						<input type="checkbox" id="isRemPwd" th:cheched="${isRemPwd}"> 十天内记住密码
					</label>
					&nbsp;&nbsp;
					<span id="msg"></span>
				</div>
				<!--					<input  type="button" id="loginBtn"  class="btn btn-primary btn-lg btn-block"  style="width: 350px; position: relative;top: 45px;">登录</input>-->
			</div>
		</form>
		<button id="loginBtn" class="btn btn-primary btn-lg btn-block"  style="width: 350px; position: relative;top: 45px;">登录</button>
		<button id="enrollBtn" style="width: 350px; ;top: 45px;position: relative;align-items: center;	border:0; outline:none;background-color: transparent;">没有账号，点击注册</button>
	</div>
</div>
</body>
<script type="text/javascript">
	$("#loginBtn").click(function (){

		// $(window).keydown(function (e){
		$(window).bind('keydown',function (e){
			if (e.keyCode == 13){
				$("#loginBtn").click()
			}
		})


		var loginAct = $.trim($("#loginAct").val())
		var loginPwd = $.trim($("#loginPwd").val())
		var isRemPwd = $.trim($("#isRemPwd").prop("checked"))
		if (loginAct==""){
			alert("账号不能为空")
			return
		}
		if (loginPwd==""){
			alert("密码不能为空")
			return
		}
		$("#msg").text("正在努力验证中...")
		$.ajax({
			url:"settings/qx/user/login",
			data:{
				loginAct:loginAct,
				loginPwd:loginPwd,
				isRemPwd:isRemPwd
			},
			type:"post",
			typeData:"json",
			success:function (data){
				if (data.code=='1'){
					window.location.href = "workbench/toIndex"
				}else {
					$("#msg").html(data.message)					}
			}
		})
	})

	$("#enrollBtn").click(function () {
		window.location.href = "settings/qx/user/toEnroll";
	})
</script>
</html>
